/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.view.render;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Paint;
import java.awt.Stroke;


/**
 * @author chunquedong
 * 
 */
public class Style2D {
	private Paint areaColor;
	private Paint lineColor;
	private Paint pointColor;

	private boolean needPoint;
	private boolean needLine;
	private boolean needArea;

	private boolean visible;
	private Stroke stroke;//画笔样式
	private int pointSize;

	public Style2D() {
		setAreaColor(Color.green);
		setPointColor(Color.blue);
		setLineColor(Color.red);
		needPoint = false;
		needLine = true;
		needArea = true;
		visible = true;
		stroke = new BasicStroke();
		pointSize = 7;
	}

	public Paint getAreaColor() {
		return areaColor;
	}

	public void setAreaColor(Paint color) {
		this.areaColor = color;
	}

	public Paint getLineColor() {
		return lineColor;
	}

	public void setLineColor(Paint boundaryColor) {
		this.lineColor = boundaryColor;
	}

	public Paint getPointColor() {
		return pointColor;
	}

	public void setPointColor(Paint pointColor) {
		this.pointColor = pointColor;
	}

	// ------------------------------------------------------------
	private static Style2D style1;
	private static Style2D style2;
	private static Style2D style3;
	
	public static Style2D style1() {
		if(style1==null){
			style1 = new Style2D();
			style1.setAreaColor(Color.red);
			style1.setPointColor(Color.yellow);
			style1.setLineColor(Color.blue);
		}
		return style1;
	}

	public static Style2D style2() {
		if(style2==null){
			style2 = new Style2D();
			style2.setAreaColor(Color.blue);
			style2.setPointColor(Color.red);
			style2.setLineColor(Color.yellow);
		}
		return style2;
	}

	public static Style2D style3() {
		if(style3==null){
			style3 = new Style2D();
			style3.setAreaColor(Color.yellow);
			style3.setPointColor(Color.blue);
			style3.setLineColor(Color.red);
		}
		return style3;
	}

	public boolean isNeedPoint() {
		return needPoint;
	}

	public void setNeedPoint(boolean needPoint) {
		this.needPoint = needPoint;
	}

	public boolean isNeedLine() {
		return needLine;
	}

	public void setNeedLine(boolean needLine) {
		this.needLine = needLine;
	}

	public boolean isNeedArea() {
		return needArea;
	}

	public void setNeedArea(boolean needArea) {
		this.needArea = needArea;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public Stroke getStroke() {
		return stroke;
	}

	public void setStroke(Stroke stroke) {
		this.stroke = stroke;
	}

	public int getPointSize() {
		return pointSize;
	}

	public void setPointSize(int pointSize) {
		this.pointSize = pointSize;
	}
}